Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use pipenv in image building dockerfile #36

Merged
merged 21 commits into from
Mar 28, 2018
Merged

Conversation

jimexist
Copy link
Member

@jimexist jimexist commented Feb 15, 2018

ready for review now

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@jlewi
Copy link
Contributor

jlewi commented Feb 15, 2018

Is this ready for review? I ask because of the TODO? If not please put wip in the title.

@@ -92,13 +92,16 @@ RUN cd /tmp && \
mv ks_0.8.0_linux_amd64/ks /usr/local/bin && \
chmod a+x /usr/local/bin/ks

COPY ./requirements.txt /tmp/requirements.txt
COPY ./Pipfile ./Pipfile.lock /tmp/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this get used anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimexist jimexist changed the title Use pipenv? use pipenv Feb 25, 2018
@jimexist
Copy link
Member Author

@jlewi can you try to toggle and enable https://travis-ci.org/kubeflow/testing?

@jlewi
Copy link
Contributor

jlewi commented Feb 27, 2018

@jimexist Sorry missed your first ping. Travis should be enabled now.

@jlewi
Copy link
Contributor

jlewi commented Feb 27, 2018

@jimexist Can you create instructions for updating/generating the Pipfile.

@jimexist
Copy link
Member Author

@jlewi will do. by the way any way to update the cla flag?

@jimexist
Copy link
Member Author

nevermind - i squashed locally

@jimexist
Copy link
Member Author

@jlewi seems CLA bot didn't re-check. Can you help manually merge?

jlewi pushed a commit that referenced this pull request Feb 28, 2018
this is cherry-picked from #36 so that it can unblock others.
@jimexist jimexist changed the title use pipenv use pipenv in image building dockerfile Feb 28, 2018
@jlewi
Copy link
Contributor

jlewi commented Feb 28, 2018

@jimexist Can you update the Makefile so that you can build/push an image without tagging it latest? And then add a separate build command to tag it latest?

Then can you build/push an image to kubeflow-ci.
Then i can quickly check that the dependencies are working.

@jlewi
Copy link
Contributor

jlewi commented Feb 28, 2018

/assign jlewi

@jlewi
Copy link
Contributor

jlewi commented Mar 1, 2018

@jimexist Were you able to test this image? If you wanted to you could create an E2E test (an Argo workflow) that would build the image and then do a smoke test on that image just by running a simple python script that would try to import various dependencies.

@jlewi
Copy link
Contributor

jlewi commented Mar 20, 2018

Any update?

jlewi and others added 4 commits March 20, 2018 11:09
… process. (kubeflow#47)

We want to use a different image for security reasons because test code running in the test project could potentially modify the test worker image.

To deal with kubeflow#46 remove hashes from requirements.txt
Ankush Agarwal and others added 2 commits March 20, 2018 11:10
@jimexist
Copy link
Member Author

/retest

@jlewi
Copy link
Contributor

jlewi commented Mar 20, 2018

Thanks for updating it. Can you update the Makefile so I can try building an image and verify it works?

@jlewi
Copy link
Contributor

jlewi commented Mar 27, 2018

@jimexist the Makefile was most likely updated in another file.
Can you resolve the conflicts?

@jimexist
Copy link
Member Author

@jlewi updated, could you take a look?

@@ -47,7 +46,7 @@ def run(command, cwd=None, env=None, polling_interval=datetime.timedelta(seconds
lines.append("{0}={1}".format(k, env[k]))
logging.info("Running: Environment:\n%s", "\n".join(lines))

log_file = None
# log_file = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just delete this line?

@jlewi
Copy link
Contributor

jlewi commented Mar 28, 2018

Can you do
make push
to build a new image (but not tag it latest) and then

  1. Can you check that the python packages can be imported
  2. Post a link to the image here?

IIRC in a previous attempt there was a problem with pipenv not actually installing the packages so it would be good to verify its working now.

@jimexist
Copy link
Member Author

docker history gcr.io/kubeflow-ci/test-worker:v20180328-01bb4bc-e3b0c4
IMAGE               CREATED              CREATED BY                                      SIZE                COMMENT
3a7c875069b3        48 seconds ago       /bin/sh -c #(nop)  ENTRYPOINT ["/usr/local/b…   0B
3126fcc433b1        48 seconds ago       /bin/sh -c #(nop)  ENV PYTHONPATH=/src/kubef…   0B
a438cc458dd3        48 seconds ago       /bin/sh -c #(nop)  ENV USER=root                0B
ec4115b77de0        48 seconds ago       /bin/sh -c curl  https://get.docker.com/ | sh   185MB
52def2fd6e26        About a minute ago   /bin/sh -c chmod a+x /usr/local/bin/run_work…   520B
0de0b276dbea        About a minute ago   /bin/sh -c #(nop) COPY file:7335db716fdba146…   520B
3dcd1edd68e8        About a minute ago   /bin/sh -c chmod a+x /usr/local/bin/checkout…   2.76kB
6df67c4e7ee4        About a minute ago   /bin/sh -c #(nop) COPY file:d51a70df6dc36afb…   2.76kB
9ba7ac0ed83f        About a minute ago   /bin/sh -c cd /tmp/ &&     pip install -U pi…   244MB
bdc9c5752ed9        2 minutes ago        /bin/sh -c #(nop) COPY multi:848bf0c8dcf5bcf…   20.4kB
8332bcd7aafe        2 minutes ago        /bin/sh -c cd /tmp &&     wget https://githu…   10.3MB
d0c439ae8bbb        3 minutes ago        /bin/sh -c cd /tmp &&     wget -O ks.tar.gz …   49.3MB
9c87f1d5fd47        3 minutes ago        /bin/sh -c cd /tmp &&     wget -O glide-v0.1…   14.4MB
210187e5dc3c        4 minutes ago        /bin/sh -c curl -sS http://dl.yarnpkg.com/de…   6.18MB
60481f2a0a57        4 minutes ago        /bin/sh -c curl -sL https://deb.nodesource.c…   101MB
c5b92598233a        4 minutes ago        /bin/sh -c helm init --client-only              1.41MB
e9f542d9786b        4 minutes ago        /bin/sh -c wget -O /tmp/get_helm.sh     http…   64MB
977f59d7bbbb        4 minutes ago        /bin/sh -c wget -q https://dl.google.com/dl/…   366MB
169c06dcd53b        5 minutes ago        /bin/sh -c #(nop)  ENV PATH=/usr/local/go/bi…   0B
2d748b2b67fc        5 minutes ago        /bin/sh -c cd /tmp &&     wget -O /tmp/go.ta…   402MB
2320f38cc33f        5 minutes ago        /bin/sh -c set -ex     && apt-get update -yq…   378MB
b10bf3addc52        6 minutes ago        /bin/sh -c #(nop)  ENV LANG=C.UTF-8             0B
ad8d529b2fed        6 minutes ago        /bin/sh -c #(nop)  ENV LC_ALL=C.UTF-8           0B
361dbd1c5920        6 minutes ago        /bin/sh -c #(nop)  ENV TERM=linux               0B
2a9dbdd5af37        6 minutes ago        /bin/sh -c #(nop)  ENV DEBIAN_FRONTEND=nonin…   0B
1c15a190310f        6 minutes ago        /bin/sh -c #(nop)  MAINTAINER Jeremy Lewi       0B
f975c5035748        3 weeks ago          /bin/sh -c #(nop)  CMD ["/bin/bash"]            0B
<missing>           3 weeks ago          /bin/sh -c mkdir -p /run/systemd && echo 'do…   7B
<missing>           3 weeks ago          /bin/sh -c sed -i 's/^#\s*\(deb.*universe\)$…   2.76kB
<missing>           3 weeks ago          /bin/sh -c rm -rf /var/lib/apt/lists/*          0B
<missing>           3 weeks ago          /bin/sh -c set -xe   && echo '#!/bin/sh' > /…   745B
<missing>           3 weeks ago          /bin/sh -c #(nop) ADD file:c753df38640ab6e24…   112MB

@jimexist
Copy link
Member Author

docker run --rm -it --entrypoint python gcr.io/kubeflow-ci/test-worker:v20180328-01bb4bc-e3b0c4 -V
Python 2.7.12

@jimexist
Copy link
Member Author

docker run --rm -it --entrypoint python3 gcr.io/kubeflow-ci/test-worker:v20180328-01bb4bc-e3b0c4 -V
Python 3.5.2

@jimexist
Copy link
Member Author

jimexist commented Mar 28, 2018

docker run --rm -it --entrypoint python3 gcr.io/kubeflow-ci/test-worker:v20180328-01bb4bc-e3b0c4
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import kubernetes
>>> kubernetes.__version__
'4.0.0'

@jimexist
Copy link
Member Author

@jlewi please take a look thanks

@jlewi
Copy link
Contributor

jlewi commented Mar 28, 2018

Fantastic thank you so much.
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlewi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jlewi
Copy link
Contributor

jlewi commented Mar 28, 2018

Merging manually because of the CLA check.

@jlewi jlewi merged commit 4f8a605 into kubeflow:master Mar 28, 2018
@jimexist jimexist deleted the use-pipenv branch March 28, 2018 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants